package com.dmai.aiet.epc.archive.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dmai.aiet.epc.archive.base.PageResult;
import com.dmai.aiet.epc.archive.entity.SpecialTopicStudyActivities;
import com.dmai.aiet.epc.archive.entity.SpecialTopicStudyRecords;
import com.dmai.aiet.epc.archive.mapper.SpecialTopicStudyActivitiesDao;
import com.dmai.aiet.epc.archive.service.SpecialTopicStudyActivitiesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.MapUtils;



@Service
public class SpecialTopicStudyActivitiesServiceImpl  implements SpecialTopicStudyActivitiesService {

    @Autowired
    private SpecialTopicStudyActivitiesDao specialTopicStudyActivitiesDao;



    /**
     * 查询记录
     * @param id
     * @return
     */
    public SpecialTopicStudyActivities findById(String id){
        return specialTopicStudyActivitiesDao.findById(id);
    }

    /**
     * 分页
     * @param params
     * @return
     */
    public PageResult<SpecialTopicStudyActivities> pageAll(Map<String, Object> params){

        Page<SpecialTopicStudyActivities> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit"));
        List<SpecialTopicStudyActivities> list = specialTopicStudyActivitiesDao.pageAll(page, params);
        long total = page.getTotal();
        if (total > 0) {

        }
        return PageResult.<SpecialTopicStudyActivities>builder().data(list).code(0).count(total).build();
    }

    /**
    * 列表
    * @param params
    * @return
    */
    public List<SpecialTopicStudyActivities> findAll(Map<String, Object> params){
        return  specialTopicStudyActivitiesDao.findAll(params);
    }

}
